Test Sets based on Variables
You can use global and project-specific variables as well as custom execution configuration variables in a test set definition condition.
Global and project-specific variables
Global or project-specific variables added to the preferences, see Preferences, are used in the test set definition condition with the syntax "${variable name}"
.
More about these variables, see Global Variables and Project-specific Variables.
Prerequisite: The attribute Necessary hardware is available in the test case details. For each test case, it was specified for this attribute with which hardware the test should be run. In one of those test cases there are even three possible hardware items specified (ABC_3 version 2, ABC_3 version 2.2, ABC_5 version 1). Goal: Only those tests should be added to the test set where the attribute Necessary hardware equals ABC_3 version 2. How to: You create in your project preferences the variable reqHardware and give it for this trial the value of ABC_3 version 2. The same variable already exists as a global variable with the value Look_21. As test set definition condition you enter: "${reqHardware}" in TESTCASE.getAttribute("Necessary hardware"). Result: Only one test set is included in the test set. |
Custom execution configuration variables
Custom execution configuration variables are used in the test set definition condition with the syntax "${variable name}"
. More about these variables, see Execution Configuration Variables.
Since TPT does not know which execution configuration you are going to use, the condition is only applied with the value of the execution configuration variable when you run the test. As a result, the test set condition is evaluated the moment you start the test.
Prerequisite: For the execution configuration Config_one, the execution item variable reqHardware was created and the value of INUT_32 has been applied to it. Goal: Only the test cases with the value INUT_32 in the test details attribute Necessary hardware should be added to the test set. How to: The test set definition condition is: "${reqHardware}" in TESTCASE.getAttribute("Necessary hardware"). Result: When you open the Execution Configuration dialog, the condition is applied and the number of test cases added by the condition is displayed in brackets next to the Test set name.
|